<jsp:useBean id="sessiondata" class="bibbletex.models.SessionData"
	scope="session" />

<%@ page import="bibbletex.models.Collaboration, bibbletex.controllers.CollaborationController"%>

<%
	String page_title;
	String onloadjsfunction="";
	Collaboration c = null;
	String id_parameter = request.getParameter("cid");
	boolean show_title = true;
	String message = null;
	boolean show_navigation = true;
	String[] jstitle={"collab"};
	
	page_title = new String("Edit Collaboration");
	
	if (id_parameter == null)
	{
		if (sessiondata.collaboration == null)
			message = new String("No collaboration ID provided");
		else {
			if (sessiondata.collaboration_is_editable == false)
				message = new String("You do NOT have right to do that.");
			c = sessiondata.collaboration;
		}
	}
	else
	{
		if (Collaboration.id_is_private(id_parameter))
		{
			c = CollaborationController.load(id_parameter);
			sessiondata.collaboration = c;
		}
		else
			message = new String("You do NOT have right to do that.");
	}
%>

<%@ include file="/header.jsp"%>
<div id="Content">
	<div id="ContentCenter" class="clearfix">
<% if (message != null) { %>
<div class="error"><%=message%>
<br />Please Contact our Support.</div>

<% 
	} 
	else if (c != null) { 
%>
<div id="editContainer">
	<div class="description" style="border-left:none;border-right:2px solid #444444;">
		<h3>Edit your Collaboration</h3>
		<% boolean hidden = false; 
		   boolean show_checkbox = false; %>
		<%@ include file="/collaboration/form.jsp" %>
	</div>
	<div class="description" style="border-left:none;">
		<h3>Privacy Settings</h3>
		<% hidden = true; 
		   show_checkbox = true;%>
		<%@ include file="/collaboration/form.jsp" %>
		<br /><br /><br /><br /><br /><br />
		<h3>General Settings</h3>
		<a class="deleteCollab" href="/collaboration/delete.jsp" title="Delete the Collaboration" onclick="return confirm('Do you really want to Delete your Collaboration?')">Delete Collaboration</a>
	</div>
</div>
<% } %>
</div>
</div>
<%@ include file="/footer.jsp"%>
